<?php

// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace app\model\api\ah;

use laytp\BaseModel;
use think\model\concern\SoftDelete;

class AhOutfit extends BaseModel
{
    use SoftDelete;
    public function collect(){
        return $this->hasMany("XmUserCollect",'outfit_id','id');
    }

    public function likes(){
        return $this->hasMany("XmUserLikes",'outfit_id','id');
    }

    public function user(){
        return $this->hasOne("XmUser",'user_id','user_id');
    }

    public function label(){
        return $this->hasOne("AhLabel",'id','label_id');
    }

    public function role(){
        return $this->hasOne("AhCareer",'role_id','role_id');
    }

    public function play(){
        return $this->belongsToMany("AhPlayStyle",'AhOutfitPlayStyle','play_style_id','outfit_id');
    }

    public function playSearch(){
        return $this->hasMany("AhOutfitPlayStyle",'outfit_id','id');
    }

}